<?php
namespace Admin\Model;
use Think\Model;
class UserModel extends Model{
    protected $_validate = array(
        array('username','','账户名称已存在！',0,'unique',1),
        array('passworda','password','确认密码不正确!',0,'confirm'),
    );
    protected $_auto = array(
        array('addtime','time',3,'function'),
        array('password','md5',3,'function'),
    );
    public function getAll(){
        $list = $this->select();
        foreach($list as &$val){
            $val['addtime'] = date('Y-m-d H:i:s',$val['addtime']);
            return $list;
        }
    }
}

